//
//  ModelOfContact.m
//  UI15_SandBox_NSFileManager_NSFileHandler
//
//  Created by Scott on 16/3/29.
//  Copyright © 2016年 Scott. All rights reserved.
//

#import "ModelOfContact.h"

@implementation ModelOfContact

/** 实现NSCoding协议方法. */


/** 归档时调用此协议方法. */
- (void)encodeWithCoder:(NSCoder *)aCoder {
    
    [aCoder encodeObject:self.name forKey:@"name"];
    
    [aCoder encodeInteger:self.age forKey:@"age"];
    
}


/** 反归档时调用此协议方法. */
- (instancetype)initWithCoder:(NSCoder *)aDecoder {
    
    self = [super init];
    if (self) {
        
        // 属性赋值
        self.name = [aDecoder decodeObjectForKey:@"name"];
        
        self.age = [aDecoder decodeIntegerForKey:@"age"];
        
    }
    return self;
}





@end
